package gitee.derumin.lib_for_derumin.helpers.config.configserializers;

import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import net.minecraft.util.JsonHelper;

public class ByteSerializer implements ConfigFieldSerializer<Byte> {

    @Override
    public Byte jsonToObject(JsonElement element, String name) {
        return JsonHelper.asByte(element, name);
    }

    @Override
    public JsonElement objectToJson(Object contains) {
        return new JsonPrimitive((Byte) contains);
    }
}
